package com.itheima.Test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test004 {
    public static void main(String[] args) throws ParseException {
        //使用SimpleDateFormat类,把2018-03-04转换为2018年03月04日
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个日期(格式为:2013-03-04):");
        String s = sc.nextLine();
        SimpleDateFormat sfm = new SimpleDateFormat("yyyy-MM-dd");
        Date parse = sfm.parse(s);
        SimpleDateFormat sfm1 = new SimpleDateFormat("yyyy年MM月dd日");
        String format = sfm1.format(parse);
        System.out.println(format);
    }
}
